package com.gxuwz.eschool.fragment;
import android.content.Intent;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.gxuwz.eschool.NewsActivity;
import com.gxuwz.eschool.R;
import com.gxuwz.eschool.jiaoyiQueryActivity;
import com.gxuwz.eschool.kaGuashiActivity;
import com.gxuwz.eschool.kaJiesuoActivity;
import com.gxuwz.eschool.xiugaiPasswordActivity;

public class CardFragment extends Fragment {
    //定义修改密码的按钮
    private Button xiugai_password;
    //定义交易查询的按钮
    private Button btn_jiaoyi;
    //定义卡挂失按钮
    private Button ka_guashi;
    //定义卡解锁按钮
    private Button ka_jiesuo;

    public CardFragment() {

    }


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {

        View view =  inflater.inflate(R.layout.fragment_card, container, false);
        xiugai_password = view.findViewById(R.id.xiugai_password);
        xiugai_password.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), xiugaiPasswordActivity.class);
                startActivity(intent);
            }
        });
        //跳转到交易查询页面
        btn_jiaoyi = view.findViewById(R.id.btn_jiaoyi);
        btn_jiaoyi.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // 启动交易查询Activity
                Intent intent = new Intent(getActivity(), jiaoyiQueryActivity.class);
                // 如果需要传递时间参数或其他条件，可以在这里putExtra
                // intent.putExtra("startTime", startTimeMillis);
                // intent.putExtra("endTime", endTimeMillis);
                startActivity(intent);
            }
        });

        // 跳转到卡挂失的页面
        ka_guashi = view.findViewById(R.id.ka_guashi);
        ka_guashi.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), kaGuashiActivity.class);
                startActivity(intent);
            }
        });

        // 跳转到卡解锁的页面
        ka_jiesuo = view.findViewById(R.id.ka_jiesuo);
        ka_jiesuo.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), kaJiesuoActivity.class);
                startActivity(intent);
            }
        });

        return  view;
    }
}